# Maintainer: Sven-Hendrik Haase <svenstaro@archlinux.org>
pkgname=openshadinglanguage
pkgver=1.12.14.0
pkgrel=1
pkgdesc="Advanced shading language for production GI renderers"
arch=('loong64' 'x86_64')
url="https://github.com/imageworks/OpenShadingLanguage"
license=('custom')
depends=('boost-libs' 'openimageio' 'imath' 'freetype2' 'libpng'
         'libtiff' 'zlib' 'ncurses' 'clang15')
makedepends=('boost' 'cmake' 'python' 'llvm15' 'ninja')
optdepends=('python: the Python module')
source=($pkgname-$pkgver.tar.gz::https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/archive/refs/tags/v${pkgver}.tar.gz)
sha512sums=('51641e58fb0bba042853e3976c104decc788f1b1d3ec2e33a3f5504b11b05950dc38766ffb066b0f76edc4e0a8829d6b7dd408d9288b74d69380395b1d991bd5')

build() {
  cd OpenShadingLanguage-$pkgver

  cmake \
    -B build \
    -GNinja \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=lib \
    -DCMAKE_CXX_STANDARD=14 \
    -DLLVM_DIRECTORY=/usr/lib/llvm15 \
    -DLLVM_STATIC=0 \
    -DSTOP_ON_WARNING=OFF
  ninja -C build
}

package() {
  cd OpenShadingLanguage-$pkgver

  DESTDIR="$pkgdir/" ninja -C build install

  install -Dm644 LICENSE.md "$pkgdir"/usr/share/licenses/$pkgname/LICENSE.md
}

# vim:set ts=2 sw=2 et:
